package day6;

/**
 * @author oldliu
 * @since 1.0
 */
public class SonTest {
    public static void main(String[] args) {
        //遮罩
        Father f=new Son();
        f.print();
        System.out.println(f.name);
        f.a();
        ((Son)f).a();
    }
}
class Father{
    public String name="father";
    public void print(){
        System.out.println("name="+name);
    }
    public static void a(){
        System.out.println("static in Father");
    }
}
class Son extends Father{
    public String name="儿子";
    public void print(){
        System.out.println("name="+name);
    }

    public static void a(){
        System.out.println("static in Son");
    }
}
